#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QPushButton>
#include <QLineEdit>
#include <QLabel>
#include <QGridLayout>
#include <QMessageBox>

#include "CustomerManager.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow {
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void onAddCustomerClicked();
    void onRemoveCustomerClicked();
    void onUpdateCustomerClicked();
    void onShowAllCustomersClicked();
private:
    Ui::MainWindow *ui;
    CustomerManager customerManager;

    // UI组件
    QLineEdit *editName;
    QLineEdit *editEmail;
    QLineEdit *editId;
    QPushButton *btnAddCustomer;
    QPushButton *btnRemoveCustomer;
    QPushButton *btnUpdateCustomer;
    QPushButton *btnShowAllCustomers;


    QLabel *labelStatus;

    void setupUi();
    void connectSignalsSlots();
    void clearInputFields();
};
#endif // MAINWINDOW_H